package com.acme.bankapp;

import java.io.IOException;
import java.net.Socket;

public class BankClient {
    public void newConnection(int socketNumber) {
        new Thread() {
            @Override
            public void run() {
                try (Socket socket = new Socket("localhost", socketNumber)) {
                    ClientConnection connection = new ClientConnection(socket.getInputStream(), socket.getOutputStream());
                    connection.start();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }.start();
    }

    public static void main(String[] args) {
        new BankClient().newConnection(888);
    }
}
